Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collateral Manager V2 #116

Open
wants to merge 73 commits into
base: develop
Choose a base branch
from
Open

Conversation

ethereumdegen
Copy link
Contributor

@ethereumdegen ethereumdegen commented Jul 6, 2023

Uses thirdweb's token bundling contracts to simplify collateral management and reduce gas costs for submit bid by ~50%

Note: the thirdweb contracts variable names were changed to match the way we named them in CollateralManagerV1 but the logic has not been modified significantly.

@ethereumdegen ethereumdegen marked this pull request as ready for review July 7, 2023 20:34
Comment on lines 120 to 131
IERC165(_token._collateralAddress).supportsInterface(0x80ac58cd)
returns (bool supported721) {
require(supported721, "TokenBundle: ERC721 Interface Not Supported");
} catch {
revert("TokenBundle: ERC721 Interface Not Supported");
}
} else if (_token._collateralType == CollateralType.ERC1155) {
try
IERC165(_token._collateralAddress).supportsInterface(0xd9b67a26)
returns (bool supported1155) {
require(supported1155, "TokenBundle: ERC1155 Interface Not Supported");
} catch {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried that there are several tokens that don't implement the supportsInterface function that would cause this to fail

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the way that thirdweb contract was written. So we can either choose to change it or leave it as is based on this info. i agree w you. I wonder why they did this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we leave it for now and if we have any issues try to come up with a solution but not sure there is a good one

i.e. I wanted to figure out the token type to know which transfer function I have to call but this was the best I found
https://chat.openai.com/share/5fb9afbf-9d4b-4704-9359-145898ea906f

@github-actions github-actions bot removed the subgraph label Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants